<?php
/**
 * IG_Report_Design_Abstract
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.iwgame.com)
 * @version $Id: Abstract.php 929 2011-10-27 07:52:50Z mmxie $
 */
abstract class IG_Report_Design_Abstract
{
    protected $_viewScript;

    protected $_view;

    protected $_options;

    public function __construct($options = array())
    {
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
        $this->_view = $viewRenderer->view;

        if($options instanceof Zend_Config) {
            $options = $options->toArray();
        }

        if(!empty($options)) {
            if (isset($options['view'])) {
            	$this->_viewScript = $options['view'];
            	unset($options['view']);
            }
        }
        $this->_options = $options;
    }

    public function getViewScript()
    {
        return $this->_viewScript;
    }

    abstract public function render();
}